package com.yuan.common.regular;

/**
 * 正则表达式
 * 
 * @author Beni
 * 
 */
public class RegularUtil {

	/**
	 * 提取出金额，精确到元
	 * 
	 * @param money
	 * @return
	 */
	public static String toMoney(String money) {

		if (money == null || money.isEmpty()) {
			return "0";
		}

		if (money.indexOf(".") != -1) {
			money = money.substring(0, money.indexOf("."));
		}

		return money.replaceAll("[\\D]", "");
	}
}
